# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=androguard
pkgver=3.3.5
pkgrel=5
epoch=3
groups=('blackarch' 'blackarch-binary' 'blackarch-disassembler'
        'blackarch-malware')
pkgdesc='Reverse engineering, Malware and goodware analysis of Android applications and more.'
arch=('any')
url='https://github.com/androguard/androguard'
license=('APACHE')
depends=('python' 'ipython' 'python-future' 'python-networkx' 'python-pygments'
         'python-lxml' 'python-colorama' 'python-matplotlib' 'python-asn1crypto'
         'python-click' 'python-pydot')
makedepends=('git' 'python-setuptools')
optdepends=('python-pyperclip: GUI'
            'python-pyqt5: GUI'
            'python-magic: magic'
            'python-filemagic: magic alternative'
            'python-sphinx: docs'
            'python-sphinx_rtd_theme: docs'
            'python-pydot: graphing')
source=("https://github.com/androguard/androguard/archive/v$pkgver.tar.gz")
sha512sums=('a818b6772f7637abb2f27efe817becf25f92696cf7f7479368f3eeafe80dd30a92b6db274037a704c62ce9332e7151bb859c50ccf7f60a6d8720d5771812e982')

build() {
  cd "$pkgname-$pkgver"

  python setup.py build
}

package() {
  cd "$pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  for i in "$pkgdir/usr/bin/"*.py ; do
    mv $i "$(echo $i | sed 's|.py||g')"
  done
}

